package com.yonyou.web.interactive;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;


/**
 * Created by lxp on 2017/7/27.
 */
public class NativeJavaScriptInterface {
    /**
     * Js 日志能力
     *
     * @param level
     * @param msg
     */
    @SuppressLint("LongLogTag")
    @JavascriptInterface
    public void jsLog(String level, String msg) {
        if ("debug".equals(level)) {
            Log.d("NativeJavaScriptInterface","JS调用：" + msg);
        } else if ("err".equals(level)) {
            Log.e("NativeJavaScriptInterface","JS调用：" + msg);
        } else {
            Log.v("NativeJavaScriptInterface","JS调用：" + msg);
        }

    }
}
